package com.baike.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baike.entity.Student;
import com.baike.repository.StudentRepository;
import com.baike.service.StudentService;

/**
 * 学生信息Service实现类
 * @author John
 *
 */
@Service("studentServie")
public class StudentServiceImpl implements StudentService{
	
	@Resource
	private StudentRepository studentRespository;

	@Override
	public void save(Student student) {
		studentRespository.save(student);
	}

	@Override
	public Student findById(Integer id) {
		return studentRespository.findOne(id);
	}

	@Override
	public List<Student> list() {
		return studentRespository.findAll();
	}

	@Override
	public void delete(Integer id) {
		studentRespository.delete(id);
	}

}
